<template>
  <div>
    <v-branch></v-branch>
    <div>
      <el-button class="btn" @click="add" type="primary" plain size="small"
        >添加</el-button
      >
    </div>
    <v-list @edit='edit'></v-list>
    <v-dialog ref="dialog" @cancel='cancel' :dialogInfo='dialogInfo' ></v-dialog>
  </div>
</template>

<script>
import vList from "./list.vue";
import vDialog from "./dialog.vue";
export default {
  data() {
    return {
      dialogInfo: {
        isShow: false, //用于控制子组件弹框的显示隐藏
        isAdd: true, //是否是添加
      },
    };
  },
  components: {
    vList,
    vDialog,
  },
  methods: {
    add() {
        this.dialogInfo.isShow=true;
        this.dialogInfo.isAdd=true;
    },
    cancel(e){
         this.dialogInfo.isShow = e
    },
    edit(e){
        this.dialogInfo.isShow=true;
        this.dialogInfo.isAdd=false
        this.$refs.dialog.lookup(e)
    }
  },
};
</script>

<style scoped>
</style>
